package com.yuexunit.finance.project.service;

import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Order;

import com.yuexunit.finance.project.entity.AuditWarningEntity;
import com.yuexunit.inject.annotation.Implements;
import com.yuexunit.page.PageCriteria;
import com.yuexunit.page.PageList;
import com.yuexunit.persist.PersistUtil;
import com.yuexunit.persist.annotation.Transactional;


/**
 * @author wenwenlong
 */
@Implements(AuditWarningService.class)
public class AuditWarningServiceImpl implements AuditWarningService {

	@Override
	@Transactional
	public void updateAuditWarning(AuditWarningEntity entity) {
		PersistUtil.update(entity);
	}

	@Override
	public AuditWarningEntity inquireAuditWarning(String auditWarningId) {
		return PersistUtil.get(AuditWarningEntity.class, auditWarningId);
	}
	
	@Override
	public PageList<AuditWarningEntity> inquireAuditWarningPageList(PageCriteria page) {
		DetachedCriteria criterial = DetachedCriteria.forClass(AuditWarningEntity.class);
		criterial.addOrder(Order.asc("orderNum"));
		return PersistUtil.get(criterial, page);
	}
}
